// 引入
import { CART_DATA, CART_INCR, CART_DECR, CART_DEL } from '../types'

export default {
    // 总数据
    [CART_DATA.slice(5)]({ commit }, data) {
        commit('data', data)
    },
    // 按钮++
    [CART_INCR.slice(5)]({ commit }, index) {
        // console.log(index)
        commit('incr', index)
    },
    // 按钮--
    [CART_DECR.slice(5)]({ commit }, index) {
        // console.log(index)
        commit('decr', index)
    },
    // 删除按钮
    [CART_DEL.slice(5)]({ commit }, index) {
        // console.log(index)
        commit('del', index)
    }
}